$location 		= "ftp://ftpeng.cisco.com/openstack/cisco"
$build_node_name        = "build-server"
$company_ntp_server	= "0.nl.pool.ntp.org"

$cobbler_node_ip 	= '10.60.0.10'
$node_subnet 		= '10.60.0.0'
$node_netmask 		= '255.255.255.0'
$node_gateway 		= '10.60.0.1'
$domain_name 		= 'cloud.naturalis.nl'
$cobbler_proxy 		= "http://${cobbler_node_ip}:3142/"

# Default user is: localadmin 
# Default MD5 crypted password is "ubuntu": $6$UfgWxrIv$k4KfzAEMqMg.fppmSOTd0usI4j6gfjs0962.JXsoJRWa5wMz8yQk4SfInn4.WZ3L/MCt5u.62tHDGB36EhiKF1
$admin_user 		= 'localadmin'
$password_crypted 	= '$6$UfgWxrIv$k4KfzAEMqMg.fppmSOTd0usI4j6gfjs0962.JXsoJRWa5wMz8yQk4SfInn4.WZ3L/MCt5u.62tHDGB36EhiKF1'
$autostart_puppet       = true

$controller_node_address       = '10.60.0.15'
$controller_node_network       = '10.60.0.0'
$controller_hostname           = 'control-server'
$db_allowed_network            = '10.60.0.%'
$controller_node_public        = $controller_node_address
$controller_node_internal      = $controller_node_address

$public_interface        	= 'eth0'
$private_interface		= 'eth0'
$external_interface	 	= 'eth1'

$install_drive           = '/dev/sda'

########### OpenStack Service Credentials ############
# This block of parameters is used to change the user names and passwords used by the services which
# make up OpenStack. The following defaults should be changed for any production deployment
$admin_email             = 'root@localhost'
$admin_password          = 'Cisco123'
$keystone_db_password    = 'keystone_db_pass'
$keystone_admin_token    = 'keystone_admin_token'
$nova_user		 = 'nova'
$nova_db_password        = 'nova_pass'
$nova_user_password      = 'nova_pass'
$glance_db_password      = 'glance_pass'
$glance_user_password    = 'glance_pass'
$glance_sql_connection   = "mysql://glance:${glance_db_password}@${controller_node_address}/glance"
$glance_on_swift         = false
$rabbit_password         = 'openstack_rabbit_password'
$rabbit_user             = 'openstack_rabbit_user'
# Nova DB connection
$sql_connection 	 = "mysql://${nova_user}:${nova_db_password}@${controller_node_address}/nova"
$verbose                 = false

#### end shared variables #################

# If you have multiple different hardware types or disk configurations you may need to use
# multiple block types here.
define cobbler_node($node_type, $mac, $ip, $power_address, $power_id = undef) {
  cobbler::node { $name:
    mac 	   => $mac,
    ip 		   => $ip,
    power_address  => $power_address,
    power_user 	   => "admin",
    power_password => "password",
    power_type     => "ether_wake",
    power_id       => $power_id,
    profile 	   => "precise-x86_64-auto",
    domain         => $::domain_name,
    node_type 	   => $node_type,
    preseed 	   => "cisco-preseed",
  }
}

node /build-node/ inherits master-node {


  cobbler_node { "control-server": node_type => "control", mac => "18:03:73:1e:06:12", ip => "10.60.0.15", power_address  => "10.60.0.15" }

# Begin compute node
  cobbler_node { "compute-server01": node_type => "compute", mac => "00:1f:29:56:6e:81", ip => "10.60.0.21", power_address  => "10.60.0.21" }
#  cobbler_node { "compute-server02": node_type => "compute", mac => "00:50:56:84:a6:3f", ip => "10.60.0.22", power_address  => "10.60.0.122" }
#  cobbler_node { "compute-server03": node_type => "compute", mac => "00:50:56:84:52:1c", ip => "10.60.0.23", power_address  => "10.60.0.123" }
}

node build-server inherits build-node { }
node control-server inherits os_base { 
  class { control: crosstalk_ip => '10.60.0.15'} 
}

node compute-server01 inherits os_base {
   class { compute: internal_ip => '10.60.0.21', crosstalk_ip => '10.60.0.21'} 
}


# node compute-server02 inherits os_base { class { compute: internal_ip => '10.60.0.22', crosstalk_ip => '10.60.0.22'} }
# node compute-server03 inherits os_base { class { compute: internal_ip => '10.60.0.23', crosstalk_ip => '10.60.0.23'} }


########################################################################
### All parameters below this point likely do not need to be changed ###
########################################################################

### Advanced Users Configuration ###
# These four settings typically do not need to be changed
# In the default deployment, the build node functions as the DNS and static DHCP server for
# the OpenStack nodes. These settings can be used if alternate configurations are needed
$node_dns       = "${cobbler_node_ip}"
$ip 		= "${cobbler_node_ip}"
$dns_service 	= "dnsmasq"
$dhcp_service 	= "dnsmasq"

import 'cobbler-node'
import 'core'


node default {
  notify{"Default Node: Perhaps add a node definition to site.pp": }
}
